package com.hamster.crmpre.web;

import com.hamster.crmpre.pojo.Customer;
import com.hamster.crmpre.service.InvitationRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 分公司  合伙人   vip  推荐的记录
 * @author Tarry
 * @create 2020/1/10 11:41
 */
@RestController
@RequestMapping("invitationRecord")
public class InvitationRecordController {
    @Autowired
    private InvitationRecordService invitationRecordService;

    /**
     * vip 或 合伙人 查看推荐 的客户
     * @return
     */
    @GetMapping("vipRefer")
    public ResponseEntity<List<Customer>> customerListByVip(){
        List<Customer> list =  invitationRecordService.customerListByVip();
        return ResponseEntity.ok(list);
    }

    /**
     * 分公司查看自己 开发的客户
     * @return
     */
    @GetMapping("companyRefer")
    public ResponseEntity<List<Customer>> customerListByCompany(){
        List<Customer> list =  invitationRecordService.customerListByCompany();
        return ResponseEntity.ok(list);
    }


}
